#include<stdio.h>

int main()
{
    int a, b, c, x, y;
    scanf("%d %d", &a, &b);
    x = a;
    y = b;
    while(a % b != 0)
    {
        c = a;
        a = b;
        b = c % a;
    }
    a = x / b * y;
    printf("%d %d", b, a);
    return 0;
}
/*
a = 4, b = 6;
x = 4, y = 6;
b --> 2
a --> 4
a = 4 / 2 * 6 == 12

*/